local app = require 'app'
local game = app.game.running
local pokerlib = game.pokerlib

local poker_container = game.ui.element(pokerlib.core.poker_container)

function poker_container:select_poker_by_client(client_values)
    for _, poker in ipairs(self.hand) do
        if poker.selected then
            poker:unselect()
        end
    end
    self.will_selected_poker = {}

    for _, client_value in ipairs(client_values) do
        for _, poker in ipairs(self.hand) do
            if not poker.selected and poker.data.client_value == client_value then
                poker:select()
                break
            end
        end
    end
    
    if self.config.select_change then
        self.config.select_change(self)
    end
end

return poker_container